package com.umeox.watch.moto.chat.bean;


import android.content.ContentValues;

import com.umeox.watch.moto.dataservice.DataProvider;

/**
 * 上层使用的群成员数据模型
 */
public class GroupMemberDetail {

    private String memberId; //用户id
    private String groupId; //所属群的ID
    private int  type;//0：群主；1：管理员；2：普通成员；
    private String name;//昵称
    private String avatar;//头像
    private int avatarIndex;//固定头像的下标
    private int createTime;//加入时间 秒

    public static GroupMemberDetail convertFromValues(ContentValues values) {
        if (values == null) {
            return null;
        }
        GroupMemberDetail detail = new GroupMemberDetail();
        detail.memberId = values.getAsString(DataProvider.IMGroupMemberProvider.MEMBER_ID);
        detail.groupId = values.getAsString(DataProvider.IMGroupMemberProvider.GROUP_ID);
        detail.type = values.getAsInteger(DataProvider.IMGroupMemberProvider.TYPE);
        detail.name = values.getAsString(DataProvider.IMGroupMemberProvider.NAME);
        detail.avatar = values.getAsString(DataProvider.IMGroupMemberProvider.AVATAR);
        detail.avatarIndex = values.getAsInteger(DataProvider.IMGroupMemberProvider.AVATAR_INDEX);
        detail.createTime = values.getAsInteger(DataProvider.IMGroupMemberProvider.CREATE_TIME);
        return detail;
    }

    public String getMemberId() {
        return memberId;
    }

    public void setMemberId(String memberId) {
        this.memberId = memberId;
    }

    public String getGroupId() {
        return groupId;
    }

    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public int getAvatarIndex() {
        return avatarIndex;
    }

    public void setAvatarIndex(int avatarIndex) {
        this.avatarIndex = avatarIndex;
    }

    public int getCreateTime() {
        return createTime;
    }

    public void setCreateTime(int createTime) {
        this.createTime = createTime;
    }

    @Override
    public String toString() {
        return "GroupMemberDetail{" +
                "memberId='" + memberId + '\'' +
                ", groupId='" + groupId + '\'' +
                ", type=" + type +
                ", name='" + name + '\'' +
                ", avatar='" + avatar + '\'' +
                ", avatarIndex=" + avatarIndex +
                ", createTime=" + createTime +
                '}';
    }
}
